Optimal. Leaf size=61 \[ -\frac {(a+b)^2 \log (1-\sin (c+d x))}{2 d}+\frac {(a-b)^2 \log (1+\sin (c+d x))}{2 d}-\frac {b^2 \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2747, 716, 647,
31} \begin {gather*} \frac {(a-b)^2 \log (\sin (c+d x)+1)}{2 d}-\frac {(a+b)^2 \log (1-\sin (c+d x))}{2 d}-\frac {b^2 \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 716
Rule 2747
Rubi steps
\begin {align*} \int \sec (c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b \text {Subst}\left (\int \frac {(a+x)^2}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b \text {Subst}\left (\int \left (-1+\frac {a^2+b^2+2 a x}{b^2-x^2}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b^2 \sin (c+d x)}{d}+\frac {b \text {Subst}\left (\int \frac {a^2+b^2+2 a x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b^2 \sin (c+d x)}{d}-\frac {(a-b)^2 \text {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac {(a+b)^2 \text {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=-\frac {(a+b)^2 \log (1-\sin (c+d x))}{2 d}+\frac {(a-b)^2 \log (1+\sin (c+d x))}{2 d}-\frac {b^2 \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 54, normalized size = 0.89 \begin {gather*} \frac {-(a+b)^2 \log (1-\sin (c+d x))+(a-b)^2 \log (1+\sin (c+d x))-2 b^2 \sin (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 62, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a b \ln \left (\cos \left (d x +c \right )\right )+b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(62\) |
default | \(\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a b \ln \left (\cos \left (d x +c \right )\right )+b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(62\) |
norman | \(\frac {-\frac {2 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 b^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(131\) |
risch | \(2 i a b x +\frac {i b^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {i b^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {4 i a b c}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}\) | \(175\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 60, normalized size = 0.98 \begin {gather*} -\frac {2 \, b^{2} \sin \left (d x + c\right ) - {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 62, normalized size = 1.02 \begin {gather*} -\frac {2 \, b^{2} \sin \left (d x + c\right ) - {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.14, size = 62, normalized size = 1.02 \begin {gather*} -\frac {2 \, b^{2} \sin \left (d x + c\right ) - {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.16, size = 50, normalized size = 0.82 \begin {gather*} -\frac {\frac {\ln \left (\sin \left (c+d\,x\right )-1\right )\,{\left (a+b\right )}^2}{2}-\frac {\ln \left (\sin \left (c+d\,x\right )+1\right )\,{\left (a-b\right )}^2}{2}+b^2\,\sin \left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________